package com.ds.common.web.configuration;

import com.ds.common.web.handle.GlobalExceptionHandler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;

/**
 * @class: WebMvcConfiguration
 * @description:
 * @author: fs
 * @create: 2024/9/6 17:32
 **/
@AutoConfiguration
@ConditionalOnWebApplication
public class WebConfiguration {

    @Bean
    @ConditionalOnMissingBean
    GlobalExceptionHandler globalWebExceptionHandler() {
        return new GlobalExceptionHandler();
    }
}
